package com.woniuxy.vuecli.service.impl;

import com.woniuxy.vuecli.mapper.PermissionMapper;
import com.woniuxy.vuecli.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author author
 * @Create 2024-03-07 15:26
 */
@Service
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    PermissionMapper permissionMapper;

    @Override
    public List<String> getByEid(int eid) {
        //permission:eid   permission:1    permission:2
        return permissionMapper.selectByEid(eid).stream()
                .map(permission ->  permission.getPath())
                .collect(Collectors.toList());
    }
}
